<template>
    <div style="text-align: center;margin-top: 60px">
        <van-nav-bar fixed="true" title="个人中心"></van-nav-bar>
        <van-icon size="large" style="" name="https://b.yzcdn.cn/vant/icon-demo-1126.png"/>
        <van-cell title="个人信息" is-link to="userMessage"/>
        <van-cell title="辅助功能" is-link to="buy"/>
        <van-cell title="分享好友" @click="showShare = true" is-link to=""/>
        <van-share-sheet
                v-model="showShare"
                title="将本应用分享给好友！"
                :options="options"
                @select="onSelect"
        />
        <van-cell title="问题反馈" is-link to="userSuggest"/>
        <van-cell title="关于我们" is-link to="about"/>
        <van-button @click="loginOut" type="danger" style="margin-top: 20px;">退出登录</van-button>
    </div>
</template>
<script>
    import Toast from "vant/lib/toast";

    export default {
        name: "userCenter",
        data() {
            return {
                showShare: false,
                options: [
                    {name: '微信', icon: 'wechat'},
                    {name: '微博', icon: 'weibo'},
                    {name: '复制成功', icon: 'link'},
                    {name: '分享海报', icon: 'poster'},
                    {name: '二维码', icon: 'qrcode'},
                ],
            };
        },
        methods: {
            onSelect(option) {
                Toast(option.name);
                this.showShare = false;
            },
            loginOut(){
                localStorage.removeItem('token')
                this.$router.push('login')
            }
        },
    }
</script>

<style scoped>

</style>
